home *** CD-ROM | disk | FTP | other *** search
/ Aminet 23 / Aminet 23 (1998)(GTI - Schatztruhe)[!][Feb 1998].iso / Aminet / dev / amos / AMOS1097.lzh / AMOSLIST / 000044_amos-request@svcs1.digex.net_Fri Oct 3 12:49:36 1997.msg < prev    next >
Internet Message Format  |  1997-11-02  |  3KB

  1. Received: from svcs1.digex.net (svcs1.digex.net [204.91.197.224])
  2.     by mail2.access.digex.net (8.8.5/8.8.5) with ESMTP id MAA12268
  3.     for <mcox@access.digex.net>; Fri, 3 Oct 1997 12:49:34 -0400 (EDT)
  4. Received: (from daemon@localhost)
  5.     by svcs1.digex.net (8.8.5/8.8.5) id IAA04111
  6.     for amos-out; Fri, 3 Oct 1997 08:58:50 -0400 (EDT)
  7. Received: from mail4.access.digex.net (mail4.access.digex.net [205.197.247.2])
  8.     by svcs1.digex.net (8.8.5/8.8.5) with ESMTP id IAA04104
  9.     for <amos-list@svcs1.digex.net>; Fri, 3 Oct 1997 08:58:47 -0400 (EDT)
  10. Received: from mail.redrose.net (mail.redrose.net [204.249.184.22])
  11.     by mail4.access.digex.net (8.8.5/8.8.5) with SMTP id IAA18664
  12.     for <amos-list@access.digex.net>; Fri, 3 Oct 1997 08:58:45 -0400 (EDT)
  13. Received: (qmail 21158 invoked from network); 3 Oct 1997 12:58:25 -0000
  14. Received: from lp3-7.redrose.net (HELO redrose.net) (mushy-pd@205.246.86.199)
  15.   by mail.redrose.net with SMTP; 3 Oct 1997 12:58:25 -0000
  16. From: Mush <mushypd@redrose.net>
  17. Reply-To: mushypd@redrose.net
  18. To: Peter Falkesand <peter.falkesand@vux.alingsas.se>
  19. CC: amos-list@access.digex.net
  20. Date: Fri, 03 Oct 1997 08:58:07 +0500
  21. Message-ID: <yam7215.365.4609936@mail.redrose.net>
  22. In-Reply-To: <199710030432.GAA00597@vux.alingsas.se>
  23. X-Mailer: YAM 1.3.4 [020] - Amiga Mailer by Marcel Beck
  24. Organization: Mushroom PD - AMOS Public Domain Library
  25. Subject: Re: Sorting routine.
  26. MIME-Version: 1.0
  27. Content-Type: text/plain
  28. Status: O
  29. X-Status: 
  30.  
  31. The man most directly responsible for this twaddle was Peter Falkesand, who
  32. did thus comment on Sorting routine. on the night of 03-Oct-97:
  33. -> Hi!
  34.  
  35. -> Is there a smooth way to sort 20 variables???
  36.  
  37. -> and not do like this..
  38.  
  39. -> --------------------------------
  40.  
  41. -> If score1_1(1)>score2_1(1)
  42.  
  43. -> Loke S7+40,Leek(S5+20)
  44.  
  45. -> endif
  46.  
  47. -> if score1_2(2)>score2_1(1)
  48.  
  49. -> loke s7+60,leek(s5+40)
  50.  
  51. -> endif
  52.  
  53. -> -------------------------------
  54.  
  55. Hmm, i have never *ever* tried to do it this way, it would be wayyy to big.
  56. Twinz used a high score table of 3 sets of 10 positions, and i'll go get the
  57. source and paste it into here...
  58.  
  59.       For N=1 To 10
  60.          TP=TSCORE(N)
  61.          If SCORE>TP : Rem or N=2 
  62.             For O=10 To N Step -1 : TSCORE(O)=TSCORE(O-1) :
  63. TSCORE$(O)=TSCORE$(O-1) : Next O
  64.             TSCORE(N)=SCORE : TSCORE$(N)=TEX$
  65.          End If 
  66.       Next N
  67.  
  68. The routine finds the position of the highest point in the table it can go (if
  69. any) by running through all possible entries, and its higher value will be
  70. first, and N will be loaded with the current slightly-lower value.
  71.  
  72. The second part of the routine, shuffles them all down by 1 position, from 1
  73. to
  74. 2, 2 to 3 etc. and inserts the value in SCORE in the correct space.
  75.  
  76. Andrew "Mushroom" Kellett
  77. --
  78.  Email: Andy Kellett <mushypd@redrose.net>  Team *AMOS* + IAPA Team *AMIGA*
  79.   alt.religion.amos - AMOS now on usenet! AMOS Mailinglist also mirrored
  80.  
  81.      World's Largest AMOS Homepages - http://www.mushy-pd.demon.co.uk
  82.  
  83.          Massive FTP site with AMOS/C64 and Mods/Samples + more at
  84.                             mushy-pd.dyn.ml.org
  85.